{% extends 'base.html' %}

{% block title %}注册{% endblock %}

{% block body %}
<!-- register section ends -->
<section class="register">
    <h1 class="heading"> <span>注册</span> register </h1>
    <div class="row">
        <form method="post" novalidate>
            {{ form.csrf_token() }}
            
            {{ form.name }}
            <!-- <input type="text" placeholder="请输入用户名" class="box"> -->
            {% if form.name.errors.0 %}
            <div class="error">
                <span>{{ form.name.errors.0 }}</span>
            </div>
            {% endif %}

            {{ form.password }}
            <!-- <input type="password" placeholder="请输入密码" class="box"> -->
            <div class="error">
                {% if form.password.errors.0 %}
                <span>{{ form.password.errors.0 }}</span>
                {% endif %}
            </div>
            
            {{ form.confirm }}
            <!-- <input type="password" placeholder="请再次输入密码" class="box"> -->
            {% if form.confirm.errors.0 %}
            <div class="error">
                <span>{{ form.confirm.errors.0 }}</span>
            </div>
            {% endif %}

            <div class="flex justify-center">
                <div id="verify"></div>
                <input type="hidden" name="token">
            </div>
            
            <div class="registerBtn">
                {{ form.submit() }}
                <!-- <input type="submit" value="注册" class="btn gradient"> -->
            </div>
            
            <div class="flex justify-end fw5 f3">
                <a class="pa3" href="/login">已有帐号,点我登陆<i class="fas fa-registered"></i></a>
            </div>

            {% if tips %}
            <div class="errors">
                ❤️<span>{{ tips }}</span>
            </div>
            {% endif %}

        </form>
    </div>
</section>
{% endblock %}
